﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace craigsPack
{
    /// <summary>
    /// A Interface for web providers
    /// </summary>
    public interface IWebProvider
    {
        /// <summary>
        /// Searches a website using a custom web provider
        /// </summary>
        /// <param name="settings"></param>
        void Search(WebProviderSearchSettings settings);
        /// <summary>
        /// Loads the current page with content downloaded from the url
        /// </summary>
        void GotoUrl();
        /// <summary>
        /// Gets name of provider
        /// </summary>
       string Name { get; }
        /// <summary>
        /// Gets current url
        /// </summary>
       string CurrentUrl { get; }
        /// <summary>
        /// Occurs when a search completes and returns all results
        /// </summary>
       event EventHandler<SearchResultsEventArgs> SearchComplete;
        /// <summary>
        /// Occurs when the current page content has changed
        /// </summary>
       event EventHandler CurrentPageChanged;
        /// <summary>
        /// Occurs when a search found any results
        /// </summary>
       event EventHandler<SearchResultsEventArgs> FoundResults;
        /// <summary>
        /// Gets a <c>UrlBuilder</c>
        /// </summary>
       UrlBuilder UrlBuilder { get; }
        /// <summary>
        /// Gets the current page content
        /// </summary>
       string CurrentPage { get; }
       /// <summary>
       /// Gets the current search settings
       /// </summary>
       WebProviderSearchSettings SearchSettings { get; }
    }
}
